package com.yu.yupicture.Untils;

import com.yu.yupicture.exception.ErrorCode;
import com.yu.yupicture.exception.biusnessException;

public class ThrowUntil {

    public static void throwIf(boolean expression, ErrorCode errorCode) {
        if (expression) {
            throw new biusnessException(errorCode);
        }
    }

    public static void throwIf(boolean expression, ErrorCode errorCode, String message) {
        if (expression) {
            throw new biusnessException(errorCode, message);
        }
    }
    public static void throwIf(boolean expression ,RuntimeException  e) {
        if (expression) {
            throw e;
        }
    }

}
